//q7a.cpp
//This program takes a decimal number and convert it to romanian format
//
//Binyamin 28 december 2017
//===========================================================================
#include <iostream>

using namespace std;
//1. Prompt for the number.
//2. Capture the number.
//3. Circle through the digits and print a corosponding Roman digit

int main()
{
	int num, i; // num - num as insereted by the user.
		    // i - looper for the for loops
	cout << "Please enter a num" << endl;
	cin >> num;
	for(i=1000; i<=num; i+=1000)
	{
		cout<< 'M';
	}
		num = num % 1000;
	if(num >= 500)
	{
		cout<< 'D';
		num = num - 500;
	}
	for(i=100;i<=num; i+=100)
	{
		cout<< 'C';
	}
		num = num % 100;
	if(num >= 50)
	{
		cout<< 'L';
		num = num - 50;
	}
	for(i=10;i<=num;i+=10)
	{
		cout<< 'X';
	}
	num = num % 10;
	if(num >= 5)
	{
		cout<< 'V';
		num = num - 5;
	}
	for(i=1;i<=num;i++)
	{
		cout<< 'I';
	}
	cout << endl;
	
	return 0;
}
//output
//Please enter a num
//2016
//MMXVI
